<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>管理员界面</title>
    <link rel="stylesheet" href="static/css4/bootstrap.min.css">
    <script src="static/jq/jquery.js"></script>
    <script src="static/js4/bootstrap.min.js"></script>
    <style type="text/css">
        html body {
            height: 100%;
            margin: 0;
        }

        .header-logo {
            height: 15%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .bg-content {
            min-height: 100%;
            margin-bottom: -80px;
        }

        .bg- {
            background-color: #6495ED;
        }

    </style>
</head>
<body>
<div class="bg-content">
    <div class="header-logo">
        <h1>欢迎来到管理员页面</h1>
    </div>
    <nav class="navbar navbar-expand-sm bg- navbar-dark">
        <div class="container">
            <ul class="navbar-nav">
                <li class="nav-item"><a href="${pageContext.request.contextPath}/toManagerIndex"
                                        class="nav-link link-light px-2 active">主页</a></li>
                <li class="nav-item"><a href="${pageContext.request.contextPath}/toStuShow"
                                        class="nav-link link-light px-2">学生信息</a></li>
                <li class="nav-item"><a href="${pageContext.request.contextPath}/toStuMistakeShow"
                                        class="nav-link link-light px-2">学生考勤信息</a></li>
                <li class="nav-item"><a href="${pageContext.request.contextPath}/toStushow"
                                        class="nav-link link-light px-2">学生考勤操作</a></li>
<%--                <li class="nav-item"><a id="toUpload" href="${pageContext.request.contextPath}/toUpload"--%>
<%--                                        class="nav-link link-light px-2">数据上传下载</a></li>--%>
                <li class="nav-item"><a id="toUpload" href="#"
                                        class="nav-link link-light px-2">数据上传下载</a></li>
                <li class="nav-item"><a href="${pageContext.request.contextPath}/toUpdate"
                                        class="nav-link link-lig ht px-2">修改个人信息</a></li>
                <li class="nav-item"><a href="${pageContext.request.contextPath}/toUpdate_pw"
                                        class="nav-link link-light px-2">修改密码</a></li>
                <li class="nav-item"><a href="#" class="nav-link link-light px-2">About</a></li>
            </ul>
            <ul class="navbar-nav justify-content-end">
                <li class="nav-item"><a href="#" class="nav-link link-light px-2"></a></li>
                <li class="nav-item">
                    <text class="nav-link link-light px-2" style="color:#000000;"><b>你好，${manager.name}</b>
                    </text>
                </li>
                <li class="nav-item"><a href="${pageContext.request.contextPath}/logout"
                                        class="nav-link link-light px-2">退出</a></li>
            </ul>
        </div>
    </nav>
    <div class="container">
        <h1 style="color:gray; font-size:3em;padding: 100px;">~：欢迎来到${manager.cdorm}宿舍楼--</h1>
        <span></span>
    </div>
</div>
<div style="background-color:#fff; height:20px;margin-bottom:0px"></div>
<footer class="footer" style="background-color:#F6F7F8; height:60px;margin-bottom:0px">
    <div class="container text-center">
        <p style="text-align: center;color: #777">
            copy© 2022-2022 舒崇 版权所有
            <br><br>
        </p>
    </div>
    <div id="gotop" style="display: block;"><a class="gotop" draggable="false"></a></div>
</footer>
<script type="text/javascript">
    $("#toUpload").click(function () {
        var amount = "${manager.amount}";
        $.ajax({
            url:"${pageContext.request.contextPath}/getAuthorAmount",
            type:"POST",
            data:"amount="+amount,
            success:function(result){
                if(result.code==100){
                    console.log(result.extend.author);
                    if(result.extend.author[0].statu!=2){
                        alert("权限不足！");
                        return;
                    }else{
                        window.location.href="${pageContext.request.contextPath}/toUpload";
                    }
                }else if(result.code==200){
                    alert("权限不足！")
                }
            }
        });
    });
</script>
</body>
</html>
